<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page isELIgnored="false"%>
<c:set var="rootPath" value="${pageContext.request.contextPath}"></c:set>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>城市信息</title>
<link href="${rootPath}/fare/lib/ligerUI/skins/Aqua/css/ligerui-all.css"
	rel="stylesheet" type="text/css" />
<link href="${rootPath}/fare/lib/ligerUI/skins/ligerui-icons.css"
	rel="stylesheet" type="text/css" />
<script type="text/javascript"
	src="${rootPath}/js/jquery/jquery-1.8.3.min.js"></script>
<script type="text/javascript"
	src="${rootPath}/fare/lib/ligerUI/js/core/base.js"></script>
<script type="text/javascript"
	src="${rootPath}/fare/lib/ligerUI/js/ligerui.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>地区城市管理</title>
<script type="text/javascript">
$(function()
{
	 //布局
    $("#layout1").ligerLayout({ leftWidth: 210, height: '100%',space:2});
	var height = $(".l-layout-center").height();
	//Tab
	$("#framecenter").ligerTab({ height: height });
	 //面板
    $("#accordionFrame").ligerAccordion({ height: height - 5, speed: null });
    //使树结构的标头不显示
    $(".l-accordion-header").height("0px");
    //使左栏列表标头也不显示
    $("#framecenter .l-tab-links").height("0px");
	var currentNodeId ;
	//面板				
	$("#tree1").ligerTree({
 					 	url: '${rootPath}/cityManage/tree.action', 
 					 	checkbox: false,
 					 	idFieldName :'id',
            			parentIDFieldName :'pid',
            			textFieldName : "text",
            			attribute: ['id','text','pid','treeType'],
            			onSelect: function (node){	             
 					 		//获得节点ID值
		                   var nodeId = node.data.id;
 					 		var nodeType = node.data.treeType;
 					 		//如果ID值为
		                    if(currentNodeId === nodeId) return false;
		                     currentNodeId=nodeId;
		                     if(nodeType==null || nodeType==""){
		                    	 nodeType=0;
		                     }
		                    //显示右边列表
		                    //contentFrame.FF_Reload(node.data);
		                    $("#cityFrame").attr("src", "${rootPath}/cityManage/list.action?pid="+nodeId+"&treeType="+nodeType);
		                 }
 					 });
});
</script>

</head>
<body>
 <div id="layout1" style="width:99.2%; margin:0 auto;"> 
		<div position="left" title="城市地区树结构" id="accordionFrame"> 
			<div title="(该标头隐藏不显示)" class="l-scroll" id="accordion1">
				<ul id="tree1" style="margin-top:3px;"></ul>
				<br/>
				<br/>
			</div>
		</div>

		<div position="center" id="framecenter"> 
			<div tabid="citylist" title="城市地区列表" >
				<iframe frameborder="0" name="cityFrame" id="cityFrame" src="${rootPath}/cityManage/list.action"></iframe> 
			</div> 
		</div>
</div>
</body>
</html>